<!-- 抽取专家，转派三方 弹窗-->
<template>
  <div class="extract-expert-dialog">
    <el-dialog
      title="抽取专家"
      :visible.sync="showExtractExpertDialog"
      width="25%"
      :before-close="handleClose"
      :close-on-click-modal="false"
      custom-class="dialog-box"
    >
      <el-form :model="queryParams" label-width="120px">
        <el-form-item>
          <el-button
            type="primary"
            @click="handleExtractExpert"
            >去抽取</el-button
          >
        </el-form-item>
      </el-form>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: "ExtractExpertDialog",
  props: {
    showExtractExpertDialog: {
      type: Boolean,
      default: "",
    },
    isShowData: {
      type: Object,
      default: () => {},
    },
    proId: {
      type: String,
      default: "",
    },
    reviewTask: {
      type: Object,
      default: () => {},
    },
  },
  inject: ["reload"],
  data() {
    return {
      queryParams:{}
    };
  },
  methods: {
    /** 取消按钮 */
    handleClose() {
      this.$emit("changeShowDialog", "false"); //调用父组件的自定义事件，并传值
    },
    /** 抽取专家操作 */
    handleExtractExpert() {
      if (this.proId) {
        this.$router.push({
          path: "/business_manage/manage/projectPlan",
          query: {
            projectId: this.proId,
            info:
              this.reviewTask.taskName +
              this.isShowData.approvalStage +
              "评审." +
              this.reviewTask.reviewType,
            enterType: "third",
            reviewTaskId: this.reviewTask.reviewTaskId,
          },
        });
      }
    },
    /** 确定按钮 */
    submitForm() {
      this.$refs.queryParams.validate((valid) => {
        if (valid) {
          this.queryParams.proid = this.proid;
          getTurnToThress(this.queryParams).then((res) => {
            if (res.code == 200) {
              this.$message.success("操作成功");
              this.$refs.queryParams.resetFields();
              this.$emit("changeShowDialog", "false");
              this.reload();
            }
          });
        } else {
          return false;
        }
      });
    },
    getManagementList() {
      getManagement().then((res) => {
        this.manangmentList = res;
      });
    },
  },
};
</script>

<style lang="scss"></style>
